<%--
  User: naim
  Date: Dec 23, 2009
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="/c.tld" %>
<html>
<head>
    <title>DSE ALERT!</title>
    <link href="<c:url value='/css/common.css'/>" rel="stylesheet" type="text/css">

</head>
<body>


<div id="container">
<%@include file="/header.jsp"%>

    <div id="page-header">
        Price History
    </div>
    <br/>

    <div>
        <form method="get">
            <span class="label"> Select Company: </span>
            <select name="item" onchange="document.forms[0].submit();">
                <c:forEach var="company" items="${companyNames}">
                    <option value="<c:out value='${company}'/>" <c:if test="${item == company}"> selected="selected" </c:if>>
                        <c:out value="${company}"/>
                    </option>
                </c:forEach>
            </select>
            <a href="http://dsebd.org/displayCompany.php?name=${item}" target="_blank">See it in 'DSEBD.ORG'</a>            
        </form>
    </div>

    <c:choose>
        <%--@elvariable id="list" type="java.util.List"--%>
        <c:when test="${empty dayPrices}">
            <div class="msg">
                No Price History for ${item}
            </div>
        </c:when>
        <c:otherwise>
            <form method="post">
                <table width="100%">
                    <thead>
                        <tr>
                            <th>Date</th>
                            <th>Price</th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="dp" items="${dayPrices}">
                            <tr>
                                <td class="data"><c:out value="${dp.dateInt}"/></td>
                                <td class="data"><c:out value="${dp.price}"/></td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </form>
        </c:otherwise>
    </c:choose>
<%@ include file="/footer.jsp"%>
</div>
</body>
</html>